package com.group.admin.controller;

import java.util.Arrays;
import java.util.Date;
import java.util.Map;

import com.group.common.utils.JwtUtil;
import com.group.common.utils.StringUtils;
import org.apache.http.HttpRequest;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.group.admin.entity.ShopUserEntity;
import com.group.admin.service.ShopUserService;
import com.group.common.utils.PageUtils;
import com.group.common.utils.R;

import javax.net.ssl.HttpsURLConnection;
import javax.servlet.http.HttpSession;


/**
 * 用户表
 *
 * @author gxx
 * @email hongyezhaofang.com
 * @date 2021-11-13 10:30:09
 */
@RestController
@RequestMapping("admin/shopuser")
public class ShopUserController {
    @Autowired
    private ShopUserService shopUserService;
    @Autowired
    RabbitTemplate rabbitTemplate;



    /**
     * 登录
     * @param phone 手机号
     * @param msg   验证码
     * @auth gxx
     */
    @RequestMapping("/login")
    public R login(String phone, String msg,HttpSession session){

       R r =shopUserService.login(phone,msg, session);

       return  r;
    }

    /**
     * 发送验证码
     * @param phone 电话号
     * @auth gxx
     */
    @RequestMapping("/sendmsg")
    public void sendmsg(String phone){

        rabbitTemplate.convertAndSend("groupuser",phone);

    }




}
